﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace ATMService
{
    /// <summary>
    /// Summary description for ATMService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    
    public class ATMService : System.Web.Services.WebService
    {
        ConnectDB cnnDB = new ConnectDB();
        [WebMethod]
        public Account GetAccount(string Ip)
        {
            return cnnDB.GetAccount(Ip);
        }
        [WebMethod]
        public bool ExceptMoney(int money,string Ip)
        {
            return cnnDB.ExceptMoney(money, Ip);
        }
        [WebMethod]
        public bool AddMoney(int money, string Ip)
        {
            return cnnDB.AddMoney(money, Ip);
        }
         [WebMethod]
        public bool SendingTransfer(Transaction sendingAccount)
        {
            return cnnDB.SendingAccounts(sendingAccount);
        }
        [WebMethod]
         public List<Transaction> GetHistoryTransaction(string Ip) {
             return cnnDB.GetHistoryTransaction(Ip);
         }
        [WebMethod]
        public bool ChangePIN(string PIN,string Ip)
        {
            return cnnDB.ChangePIN(PIN,Ip);
        }
        [WebMethod]
        public List<Transaction> SearchInformationWithdrawal(string Ip, string typeTransaction, DateTime fromDate, DateTime toDate)
        {
            return cnnDB.SearchInformationWithdrawal(Ip, typeTransaction, fromDate, toDate);
        }
        [WebMethod]
        public void Hello()
        { }
    }
}
